<!DOCTYPE HTML>
<html>

<head>
	<meta charset="utf-8">
	<meta name="viewport" content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0" />
	<meta name="format-detection" content="telephone=no,email=no,date=no,address=no">
	<meta name="apple-mobile-web-app-capable" content="yes">
	<meta name="apple-mobile-web-app-status-bar-style" content="#0A5AF9">
	<title>我的</title>
	<link rel="stylesheet" type="text/css" href="../css/public-head.css" />
	<link rel="stylesheet" href="../css/mine.css">
	<link rel="stylesheet" type="text/css" href="../css/api.css" />
	<link rel="stylesheet" type="text/css" href="../css/mui.min.css" />
	<link rel="stylesheet" href="../css/baseBottom.css">

</head>

<body>
	<div class="main" style="padding-bottom:20vh" id="mine_mine">
		<div class="banner">
			<div id="isLogin">
				<!--<div>
					<div><img src="../image/icon/touxiang@2x.png" alt="" /></div>
				</div>
				<div>
					<div>下午好，张先生！</div>
					<div>
						<div><img src="../image/icon/HUIY@2x.png" alt="" /></div>
						<div>VIP会员</div>
					</div>
				</div>-->
				<!-------------------------------------------1111111----------------------------------------------->
				<!-- <div class="banner" tapmode onclick="Main_Frame_two()">
            <div>
                <div>
                    <div class="img_logo"> -->
				<!--{{if isLogin.headImg==null}}-->
				<!-- <img src="../image/icon/touxiang@2x.png" alt="" /> -->
				<!--{{else}}-->
				<!--<img src="{{isLogin.headImg}}" alt="">-->
				<!--{{/if}}-->
				<!-- </div>
                </div>
                <div>
                    <div>下午好,张先生！</div>
                    <div class="member">
						<div><img src="../image/icon/HUIY@2x.png" alt="" /> VIP会员</div>
					</div> -->
				<!--<div>洗车指数：
                    <span><img src="../image/icon/xx-xg@2x.png" alt="" /></span>
                    <span><img src="../image/icon/xx-xg@2x.png" alt="" /></span>
                    <span><img src="../image/icon/xx-xg@2x.png" alt="" /></span>
                    <span><img src="../image/icon/xx-xg@2x.png" alt="" /></span>
                    <span><img src="../image/icon/xx-xg@2x.png" alt="" /></span>
                </div>-->
				<!-- </div>
        </div>
        </div> -->
				<!------------------------------------1111111111111111111-------------------------------->
			</div>
			<div id="UserInfo">
				<!-- <div tapmode onclick="">
					<div>0.00</div>
					<div>钱包</div>
				</div> -->
				<div tapmode onclick="Coupon('?a=1')">
					<div>0</div>
					<div>代金券</div>
				</div>
				<div tapmode onclick="Coupon('')">
					<div>0</div>
					<div>洗车券</div>
				</div>
				<!-- <div>
					<div>0</div>
					<div>推荐有礼</div>
				</div> -->
			</div>
		</div>
		<!--我的订单-->
		<div class="mine-order">
			<div>
				<div>
					<div></div>
					<div>我的订单</div>
				</div>
				<div>
					<div tapmode onclick="MyOrder(0)">
						<img src="../image/icon/ARROWRIGHT@2x.png" alt="" />
					</div>
				</div>
			</div>
			<div>
				<div tapmode onclick="MyOrder(0)">
					<div><img src="../image/icon/dingd-yxd@2x.png" alt="" /></div>
					<div>
						<div>
							<!-- <div>12</div> -->
						</div>
					</div>
					<div>已下单</div>
				</div>
				<div tapmode onclick="MyOrder(1)">
					<div><img src="../image/icon/dingd-dwc1@2x.png" alt="" /></div>
					<div>
						<div>
							<!-- <div>32</div> -->
						</div>
					</div>
					<div>待完成</div>
				</div>
				<div tapmode onclick="MyOrder(2)">
					<div><img src="../image/icon/dingd-dwc@2x.png" alt="" /></div>
					<div>
						<div>
							<!-- <div>3</div> -->
						</div>
					</div>
					<div>待评价</div>
				</div>
			</div>
		</div>
		<!--我的订单-->
		<!--<div class="car-msg">
			<div>
				<div>
					<div></div>
					<div>车辆信息</div>
				</div>
				<div tapmode onclick="VehicleList()">
					<div style="">车辆列表</div>
					<div>
						<img src="../image/icon/ARROWRIGHT@2x.png" alt="" />
					</div>
				</div>
			</div>
			<div tapmode onclick="archives()">
				<div><img src="../image/icon/fchelogo@2x.png" alt="" /></div>
				<div>桂A·75N17</div>
				<div>青秀区-建政街道-青秀万达银座负二楼A区06号车位</div>
			</div>
		</div>
-->
		<!--实用工具-->
		<!--<div class="tool">

			<div>
				<div>
					<div></div>
					<div>实用工具</div>
				</div>

			</div>
			<div>
				<div>
					<div><img src="../image/icon/wd-clzz.png" alt="" /></div>
					<div>车辆追踪</div>
				</div>
				<div>
					<div><img src="../image/icon/lala.png" alt="" /></div>
					<div>车辆检测</div>
				</div>
				<div>
					<div><img src="../image/icon/dingw.png" alt="" /></div>
					<div>行车轨迹</div>
				</div>
				<div>
					<div><img src="../image/icon/wd-dyjk@2x.png" alt="" /></div>
					<div>电压监控</div>
				</div>
				<div>
					<div><img src="../image/icon/tuoyuan@2x.png" alt="" /></div>
					<div>驾驶测评</div>
				</div>
			</div>
		</div>-->
	</div>
</body>
<script type="text/javascript" src="../script/public-head.js"></script>
<script type="text/javascript" src="../script/rem.js"></script>
<script type="text/javascript" src="../script/api.js"></script>
<script type="text/javascript" src="../script/mui.js"></script>
<script src="../script/template-web.js" type="text/javascript" charset="utf-8"></script>
<script type="text/html" id="loginTemp">
	{{if data<0}}
	 <div onclick="Login()" tapmode>
		<div class="login">登录</div>
		</div>
		{{else}}
		<div class="banner" tapmode onclick="Main_Frame_two()">
			<div>
				<div>
					<div class="img_logo">
						{{if data.avatar==null}}
						<img src="../image/icon/touxiang@2x.png" alt="" /> {{else}}
						<img src="{{data.avatar}}" alt="" class="avatar"> {{/if}}
					</div>
				</div>
				<div>
					<div>{{showTime}} {{data.nickname}}</div>
					<!-- <div>{{data.car_number}}</div> -->
					<div>
						<div class="member"><img src="../image/icon/HUIY@2x.png" alt="" /></div>
						<div class="member_fonsz">VIP会员</div>

					</div>
					<!--<div>洗车指数：
                    <span><img src="../image/icon/xx-xg@2x.png" alt="" /></span>
                    <span><img src="../image/icon/xx-xg@2x.png" alt="" /></span>
                    <span><img src="../image/icon/xx-xg@2x.png" alt="" /></span>
                    <span><img src="../image/icon/xx-xg@2x.png" alt="" /></span>
                    <span><img src="../image/icon/xx-xg@2x.png" alt="" /></span>
                </div>-->
				</div>
			</div>
		</div>
		{{/if}}
</script>

<script type="text/html" id="infoTemp">
	<div tapmode onclick="Wallet()">
		<div>{{wallet}}</div>
		<div>钱包</div>
	</div>
	<div tapmode onclick="Coupon('?a=1')">
		<div>{{coupons_count}}</div>
		<div>代金券</div>
	</div>
	<div tapmode onclick="Coupon('')">
		<div>{{voucher_coupons_count}}</div>
		<div>洗车券</div>
	</div>
	<div>
		<div>0</div>
		<div>推荐有礼</div>
	</div>
</script>
<script type="text/javascript">
	var showTime;
	apiready = function() {
		init()
		fnGetLoginDatamine();
		InitInfo();
	}
	headInner({
		title: '<div style="color:#000;">我的</div>',
		//headleft
		headl: '<div class="mine_1"><img src="../image/icon/Shape67@2x.png" alt="" tapmode onclick="setup()"/></div>',
		//headright
		headr: '<div class="msg_1" tapmode onclick="Being()"><img src="../image/icon/Shape11@2x.png" alt=""/></div>',
		color: "#fff", //默认是蓝色
		padding: "0px 0px 0px",
	})

	// 个人信息
	function InitInfo() {
		var user = $api.getStorage('UserBase');
		var html = template('infoTemp', user);
		document.getElementById('UserInfo').innerHTML = html;
	}

	// 获取登录信息
	function fnGetLoginDatamine() {
		fnshowTime()
		console.log("远程调用成功，我的")
		BASE.MYajax({
			'pathName': 'users/getUserInfo',
			'method': initInfo
		});
	}

	function initInfo(ret, err) {
		console.log("我的： ");
		console.log(JSON.stringify(ret));
		if (ret.code == 200) {
			var data = ret;
			data.showTime = showTime;
			console.log(JSON.stringify(data));
			var html = template('loginTemp', data);
			document.getElementById('isLogin').innerHTML = html; //绑定ID  渲染
		} else {
			reToast(ret, err)
		}
	}

	function Login() {
		api.openWin({
			name: 'Login',
			url: 'Login.html',
			bounces: false,
			opaque: false,
			showProgress: true,
			vScrollBarEnabled: false,
			hScrollBarEnabled: false,
			slidBackEnabled: false,
			delay: 1000,
			animation: {
				type: 'ripple',
				duration: 1000
			}
		});
	}

	function fnshowTime() {
		var now = new Date();
		var hour = now.getHours();
		if (hour < 6) {
			showTime = "凌晨好！"
		} else if (hour < 9) {
			showTime = "早上好！"
		} else if (hour < 12) {
			showTime = "上午好！"
		} else if (hour < 14) {
			showTime = "中午好！"
		} else if (hour < 17) {
			showTime = "下午好！"
		} else if (hour < 19) {
			showTime = "傍晚好！"
		} else if (hour < 22) {
			showTime = "晚上好！"
		} else {
			showTime = "夜里好！"
		}
	}

	//跳转

	function Coupon(param) {
		api.openWin({
			name: 'Coupon',
			url: '../html/Coupon.html',
			pageParam: {
				page: param
			}
		});
	}



	function InviteFriends_1() {
		api.openWin({
			name: 'InviteFriends_1',
			url: '../html/InviteFriends_1.html'
		});
	}

	function Wallet(){
	console.log("打开钱包");
		api.openWin({
			name: 'Wallet',
			url: '../html/Wallet.html'
		});
	}

	function MyOrder(index_) {
		console.log(index_);
		api.openWin({
			name: 'MyOrder',
			url: '../html/MyOrder.html',
			pageParam: {
				active_index: index_
			}
		});
	}

	function VehicleList() {
		api.openWin({
			name: 'VehicleList',
			url: '../html/VehicleList.html'
		});
	}

	function AddVehicle() {
		api.openWin({
			name: 'AddVehicle',
			url: '../html/AddVehicle.html'
		});
	}

	function archives() {
		api.openWin({
			name: 'archives',
			url: '../html/archives.html'
		});
	}

	function setup() {
		api.openWin({
			name: 'set-up',
			url: '../html/set-up.html'
		});
	}

	//function MessageCenter() {
	//api.openWin({
	//	name: 'MessageCenter',
	//	url: '../html/MessageCenter.html'
	// 	});
	//
	//}

	function Being() {
		api.toast({
			msg: '敬请期待~',
			duration: 2000,
			location: 'bottom'
		});
	}
</script>

</html>
